<?php
/**
 * @name ErrorController
 * @desc 错误控制器, 在发生未捕获的异常时刻被调用
 * @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
 * @author yx
 */
class ErrorController extends Yaf_Controller_Abstract {

	//从2.1开始, errorAction支持直接通过参数获取异常
	public function errorAction($exception) {
		$response = $this->getResponse();
		$this->response_data = Yaf_Registry::get('response_data');
		$this->response_data['eno'] = 500;
		$this->response_data['err'] = 'error';
		$response->setBody(json_encode($this->response_data));
	}
}
